package thread;

public class threadDemo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread=new Thread(()->{
            System.out.println("线程执行中");
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        //System.out.println("线程状态"+ thread.getState());//NEW
        thread.start();
        //System.out.println("线程状态"+ thread.getState());//RUNNABLE
        Thread.sleep(2000);//确保线程执行完
        System.out.println("线程状态"+thread.getState());//TERMINATED
    }
}
